﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;

namespace TreeBuilder
{
    public class ArrowAdorner : EllipseAdorner
    {
        public ArrowAdorner(UIElement adornedElement) : base(adornedElement)
        {
        }

        protected override void OnRender(System.Windows.Media.DrawingContext drawingContext)
        {
            if (!IsActive) return;
            var arrow = (ArrowLink) AdornedElement;

            var points = new[]
                {
                    arrow.Head.Top,
                    arrow.FromLine.StartPoint,
                    arrow.FromLine.EndPoint,
                    arrow.ArcBottomPoint
                };

            DrawPoints(points, drawingContext);
        }

    }
}
